﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using T7._1.Models;

namespace T7._1.Controllers
{
    public class DefaultController : Controller
    {
        // GET: Default
        public ActionResult Index()
        {
            return View();
        }
        public ActionResult CheckUserName(string username)
        {
            using(SchoolEntities db=new SchoolEntities())
            {
                if (db.Courses.Where(x => x.Title == username).Count() > 0)
                {
                    return Content("false");
                }
                else
                {
                    return Content("true");
                }
            }
            
        }
    }
}